package com.example.dayu521.msg_receive.conf;

import feign.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
public class Openfeign {
    /**
     *
    下面的Spring Cloud OpenFeign 提供了默认配置
     Decoder feignDecoder: ResponseEntityDecoder (which wraps a SpringDecoder)

     Encoder feignEncoder: SpringEncoder

     Logger feignLogger: Slf4jLogger

     MicrometerObservationCapability micrometerObservationCapability: If feign-micrometer is on the classpath and ObservationRegistry is available

     MicrometerCapability micrometerCapability: If feign-micrometer is on the classpath, MeterRegistry is available and ObservationRegistry is not available

     CachingCapability cachingCapability: If @EnableCaching annotation is used. Can be disabled via spring.cloud.openfeign.cache.enabled.

     Contract feignContract: SpringMvcContract

     Feign.Builder feignBuilder: FeignCircuitBreaker.Builder

     Client feignClient: If Spring Cloud LoadBalancer is on the classpath, FeignBlockingLoadBalancerClient is used. If none of them is on the classpath, the default feign client is used.

     */


    @Bean
    @Profile("prototype")
    Logger.Level feignLoggerLevel() {
        return Logger.Level.HEADERS;
    }
    /**下面的默认没有提供,需要自己配置
     *
     Logger.Level

     Retryer

     ErrorDecoder

     Request.Options

     Collection<RequestInterceptor>

     SetterFactory

     QueryMapEncoder

     Capability (MicrometerObservationCapability and CachingCapability are provided by default)

     */
    //配置feign失败回调
//    https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/#spring-cloud-feign-circuitbreaker-fallback
}
